using Game.Networking.Client;
using MemoryPack;

namespace Game.Networking {
	public sealed class S_DespawnEntityMessageHandler : BaseServerMessageHandler {

		public override ServerPacketID CommandId {
			get {
				return ServerPacketID.DespawnEntity;
			}
		}

		public override void ProcessMessage(byte[] rawCommand) {
			var ec = ClientEntityController.Instance;
			var message = MemoryPackSerializer.Deserialize<S_DespawnEntityMessage>(rawCommand);
			ec.DespawnEntity(message?.ID ?? uint.MaxValue);
		}

	}
}
